<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page isELIgnored="false"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="overflow-y: visible;">
<jsp:include page="../../../include/IncludeMain.jsp"></jsp:include>
<body style="overflow-y: visible;" onload="changeRowColor();">
	<table class="mainTable">
		<thead>
			<tr class="tableController">
				<th colspan="18">
					<h3>采购项目列表</h3>
					<div class="tableControllerButton">
						<a class="button" href="javascript:void(0)"
							onclick="this.blur(); window.location='${pageContext.request.contextPath }/pages/purchase/purchaseDetailAction!get?purchase_id=${purchase_id }'; return false;"><span><img
								src="${pageContext.request.contextPath }/js/kui/icons/application_add.png"
								align="absmiddle" />&nbsp;添加</span> </a> <a class="button"
							href="javascript:void(0)"
							onclick="this.blur(); deleteAll(); 'return false';"><span><img
								src="${pageContext.request.contextPath }/js/kui/icons/application_delete.png"
								align="absmiddle" />&nbsp;删除</span> </a> <a class="button"
							href="javascript:void(0)"
							onclick="this.blur();  window.location='${pageContext.request.contextPath }/pages/purchase/purchaseDetailAction!list'; return false;"><span><img
								src="${pageContext.request.contextPath }/js/kui/icons/anticlockwise.png"
								align="absmiddle" />&nbsp;返回</span> </a>
					</div>
				</th>
			</tr>
			<tr class="tableDefined">	

				<td>&nbsp;</td>
				<th><h4>采购单号&nbsp;:</h4></th>
				<td>${purchase.purchase_id }&nbsp;</td>
				<th><h4>经办人&nbsp;:</h4></th>
				<td>${purchase.person}&nbsp;</td>
				<th><h4>日期&nbsp;:</h4></th>
				<td>${purchase.date }&nbsp;</td>
			</tr>

			<tr class="tableTitle">
				<th>
					<h3>
						<input type="checkbox" onclick="selectAll(this);" />
					</h3>
				</th>
				<th>
					<h3>材料料号</h3>
				</th>
				<th>
					<h3>材料名称</h3>
				</th>
				<th>
					<h3>供应商名称</h3>
				</th>
				<th>
					<h3>数量</h3>
				</th>
				<th>
					<h3>单位</h3>
				</th>
				<th>
					<h3>采购状态</h3>
				</th>
				<th>
					<center>
						<h3>备注</h3>
					</center>
				</th>
				<th>
					<h3>操作</h3>
				</th>
			</tr>
		</thead>
		<tbody>
			<form
				action="${pageContext.request.contextPath }/pages/purchase/purchaseDetailAction!del?purchase_id=${purchase_id }"
				name="myForm" id="myForm" method="post">
				<c:forEach items="${pager.data}" var="purchaseDetailView">
					<c:if test="${purchaseDetailView.id!= 0}">
						<tr>
							<td width="20px"><input type="checkbox" name="id"
								value="${purchaseDetailView.id}" /></td>
							<td>${purchaseDetailView.material_id}</td>
							<td>${purchaseDetailView.material_name}</td>
							<td
								title="电话：${purchaseDetailView.supplier_telephone }，地址：${purchaseDetailView.supplier_address }">${purchaseDetailView.supplier_name}</td>
							<td>${purchaseDetailView.amount}</td>
							<td>${purchaseDetailView.unit}</td>
							<td><c:if test="${purchaseDetailView.status==0}">未采购</c:if>
								<c:if test="${purchaseDetailView.status!=0}">已采购</c:if></td>
							<td>${purchaseDetailView.comments}</td>
							<td><c:if test="${purchaseDetailView.status  == 0}">
									<a class="button-small" href="javascript:void(0)"
										onclick="this.blur(); window.location='${pageContext.request.contextPath }/pages/purchase/purchaseDetailAction!comfirm?purchaseDetail.id=${purchaseDetailView.id }&purchase_id=${purchaseDetailView.purchase_id }'; return false;"><span>确认采购</span>
									</a>
									<a class="button-small" href="javascript:void(0)"
										onclick="this.blur(); window.location='${pageContext.request.contextPath }/pages/purchase/purchaseDetailAction!get?purchaseDetailView.id=${purchaseDetailView.id }&purchase_id=${purchaseDetailView.purchase_id }'; return false;"><span>修改</span>
									</a>
									<a class="button-small" href="javascript:void(0)"
										onclick="this.blur(); deleteOne('${pageContext.request.contextPath }/pages/purchase/purchaseDetailAction!del?id=${purchaseDetailView.id }&purchase_id=${purchaseDetailView.purchase_id }'); return false;"><span>删除</span>
									</a>
								</c:if>
							</td>
						</tr>

					</c:if>
				</c:forEach>
			</form>
		</tbody>
		<tfoot>
			<tr class="tableController_bottom">
				<td colspan="18" align="center"><jsp:include
						page="../../../include/SplitPage.jsp">
						<jsp:param name="pager" value="${action.pager}" />
					</jsp:include></td>
			</tr>
		</tfoot>
	</table>

</body>
</html>
